import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Product from './views/Product.vue'
import Person from './views/Person.vue'
import Login from './views/Login.vue'
import Register from './views/Register.vue'


Vue.use(Router)

export default new Router({
    /* mode: 'history',
    base: process.env.BASE_URL, */
    routes: [
        /* {
            path: '/',
            redirect: "home"
        }, */
        {
            path: '/',
            name:'home',
            component: Home,
            children: [
                { path: "/", name: 'product',component: () => import ('./views/Product.vue') },
                { path: "person", name: 'person', component: Person },
                // { path: "/", redirect: 'product' }
            ]
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ( /* webpackChunkName: "about" */ './views/Login.vue')
        },
        {
            path: '/register',
            name: 'register',
            component: () =>
                import ( /* webpackChunkName: "about" */ './views/Register.vue')
        },
        {
            path: '/find',
            name: 'find',
            component: () =>
                import ( /* webpackChunkName: "about" */ './views/Find.vue')
        },
        {
            path: '/about',
            name: 'about',
            component: () =>
                import ( /* webpackChunkName: "about" */ './views/About.vue')
        }
    ]
})